<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>Nordic Thingy:52 v2.2.0 : Thingy Configuration Service</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet_offline.css" rel="stylesheet" type="text/css"/>
<link href="nordic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%" class="blank">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Nordic Semiconductor" src="nordic_small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nordic Thingy:52 v2.2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
<script>
var url=window.location.href.split("/").reverse()[1];
var validLinks= ["nrf5","s130","s132","s212","s332"];
var index;
for (index = 0; index < validLinks.length; ++index) {
   if ( url.indexOf(validLinks[index]) !== -1 ) {
      document.getElementById(validLinks[index]).setAttribute('class', 'doclinks docselected');
   };
};
</script>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__ble__sdk__srv__tcs.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Thingy Configuration Service<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">BLE services</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Thingy Configuration Service implementation.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__tcs__init__t.html">ble_tcs_init_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Configuration Service initialization structure.  <a href="structble__tcs__init__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__tcs__s.html">ble_tcs_s</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Configuration Service structure.  <a href="structble__tcs__s.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga8146f33ea6bcd138284006cf86405694"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#ga8146f33ea6bcd138284006cf86405694">BLE_TCS_MAX_DATA_LEN</a>&#160;&#160;&#160;(BLE_GATT_ATT_MTU_DEFAULT - 3)</td></tr>
<tr class="separator:ga8146f33ea6bcd138284006cf86405694"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabbeb84002465867f52a05442e9c312fd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#gabbeb84002465867f52a05442e9c312fd">BLE_UUID_TCS_SERVICE</a>&#160;&#160;&#160;0x0100</td></tr>
<tr class="separator:gabbeb84002465867f52a05442e9c312fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gabc4d02269d1c784f342edc872bdd29f9"><td class="memItemLeft" align="right" valign="top"><a id="gabc4d02269d1c784f342edc872bdd29f9"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#gabc4d02269d1c784f342edc872bdd29f9">ble_tcs_evt_handler_t</a>) (<a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *p_tcs, ble_tcs_evt_type_t evt_type, uint8_t *p_data, uint16_t length)</td></tr>
<tr class="memdesc:gabc4d02269d1c784f342edc872bdd29f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thingy Configuration Service event handler type. <br /></td></tr>
<tr class="separator:gabc4d02269d1c784f342edc872bdd29f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad33571ba0d7ba51659c3aa09618b3cc9"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#gad33571ba0d7ba51659c3aa09618b3cc9">ble_tcs_init</a> (<a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *p_tcs, const <a class="el" href="structble__tcs__init__t.html">ble_tcs_init_t</a> *p_tcs_init)</td></tr>
<tr class="memdesc:gad33571ba0d7ba51659c3aa09618b3cc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for initializing the Thingy Configuration Service.  <a href="#gad33571ba0d7ba51659c3aa09618b3cc9">More...</a><br /></td></tr>
<tr class="separator:gad33571ba0d7ba51659c3aa09618b3cc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a6b5889d593500659b05c563740c51a"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#ga8a6b5889d593500659b05c563740c51a">ble_tcs_mtu_set</a> (<a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *p_tcs, ble_tcs_mtu_t *p_data)</td></tr>
<tr class="memdesc:ga8a6b5889d593500659b05c563740c51a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for setting the MTU char data.  <a href="#ga8a6b5889d593500659b05c563740c51a">More...</a><br /></td></tr>
<tr class="separator:ga8a6b5889d593500659b05c563740c51a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa10dbf0cf3e90ef0a03a8244eb88532c"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#gaa10dbf0cf3e90ef0a03a8244eb88532c">ble_tcs_nfc_set</a> (<a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *p_tcs, ble_tcs_nfc_t *p_data)</td></tr>
<tr class="memdesc:gaa10dbf0cf3e90ef0a03a8244eb88532c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for setting the NFC char data.  <a href="#gaa10dbf0cf3e90ef0a03a8244eb88532c">More...</a><br /></td></tr>
<tr class="separator:gaa10dbf0cf3e90ef0a03a8244eb88532c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga10835bbd06a099abc38cdbee47c382f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__tcs.html#ga10835bbd06a099abc38cdbee47c382f6">ble_tcs_on_ble_evt</a> (<a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *p_tcs, ble_evt_t *p_ble_evt)</td></tr>
<tr class="memdesc:ga10835bbd06a099abc38cdbee47c382f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for handling the Thingy Configuration Service's BLE events.  <a href="#ga10835bbd06a099abc38cdbee47c382f6">More...</a><br /></td></tr>
<tr class="separator:ga10835bbd06a099abc38cdbee47c382f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Thingy Configuration Service implementation. </p>
<p>The Thingy Configuration Service is a simple GATT-based service with TX and RX characteristics. Data received from the peer is passed to the application, and the data received from the application of this service is sent to the peer as Handle Value Notifications. This module demonstrates how to implement a custom GATT-based service and characteristics using the S110 SoftDevice. The service is used by the application to send and receive ASCII text strings to and from the peer.</p>
<dl class="section note"><dt>Note</dt><dd>The application must propagate S110 SoftDevice events to the Thingy Configuration Service module by calling the <a class="el" href="group__ble__sdk__srv__tcs.html#ga10835bbd06a099abc38cdbee47c382f6" title="Function for handling the Thingy Configuration Service&#39;s BLE events. ">ble_tcs_on_ble_evt()</a> function from the ble_stack_handler callback. </dd></dl>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga8146f33ea6bcd138284006cf86405694"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8146f33ea6bcd138284006cf86405694">&#9670;&nbsp;</a></span>BLE_TCS_MAX_DATA_LEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_TCS_MAX_DATA_LEN&#160;&#160;&#160;(BLE_GATT_ATT_MTU_DEFAULT - 3)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Maximum length of data (in bytes) that can be transmitted to the peer by the Thingy Configuration service module. </p>

</div>
</div>
<a id="gabbeb84002465867f52a05442e9c312fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabbeb84002465867f52a05442e9c312fd">&#9670;&nbsp;</a></span>BLE_UUID_TCS_SERVICE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_UUID_TCS_SERVICE&#160;&#160;&#160;0x0100</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The UUID of the Thingy Configuration Service. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad33571ba0d7ba51659c3aa09618b3cc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad33571ba0d7ba51659c3aa09618b3cc9">&#9670;&nbsp;</a></span>ble_tcs_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tcs_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *&#160;</td>
          <td class="paramname"><em>p_tcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__tcs__init__t.html">ble_tcs_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_tcs_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for initializing the Thingy Configuration Service. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_tcs</td><td>Thingy Configuration Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tcs_init</td><td>Information needed to initialize the service.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the service was successfully initialized. Otherwise, an error code is returned. </td></tr>
    <tr><td class="paramname">NRF_ERROR_NULL</td><td>If either of the pointers p_tcs or p_tcs_init is NULL. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8a6b5889d593500659b05c563740c51a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a6b5889d593500659b05c563740c51a">&#9670;&nbsp;</a></span>ble_tcs_mtu_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tcs_mtu_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *&#160;</td>
          <td class="paramname"><em>p_tcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ble_tcs_mtu_t *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for setting the MTU char data. </p>
<p>This function updates the MTU characteristic.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tcs</td><td>Pointer to the Thingy Configuration Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_data</td><td>Pointer to the MTU data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the string was sent successfully. Otherwise, an error code is returned. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaa10dbf0cf3e90ef0a03a8244eb88532c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa10dbf0cf3e90ef0a03a8244eb88532c">&#9670;&nbsp;</a></span>ble_tcs_nfc_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_tcs_nfc_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *&#160;</td>
          <td class="paramname"><em>p_tcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ble_tcs_nfc_t *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for setting the NFC char data. </p>
<p>This function updates the NFC characteristic.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tcs</td><td>Pointer to the Thingy Configuration Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_data</td><td>Pointer to the NFC data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS</td><td>If the string was sent successfully. Otherwise, an error code is returned. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga10835bbd06a099abc38cdbee47c382f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga10835bbd06a099abc38cdbee47c382f6">&#9670;&nbsp;</a></span>ble_tcs_on_ble_evt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_tcs_on_ble_evt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__tcs__s.html">ble_tcs_t</a> *&#160;</td>
          <td class="paramname"><em>p_tcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ble_evt_t *&#160;</td>
          <td class="paramname"><em>p_ble_evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for handling the Thingy Configuration Service's BLE events. </p>
<p>The Thingy Configuration Service expects the application to call this function each time an event is received from the S110 SoftDevice. This function processes the event if it is relevant and calls the Thingy Configuration Service event handler of the application if necessary.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_tcs</td><td>Thingy Configuration Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ble_evt</td><td>Event received from the S110 SoftDevice. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="topicfooter">
<a href="mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback" id="maillink">Documentation feedback</a> | <a href="https://devzone.nordicsemi.com/questions/" target="_blank">Developer Zone</a> | <a href="http://response.nordicsemi.com/subscribe-to-our-newsletters" target="_blank">Subscribe</a> | Updated <span id="date"/>
<script>
var date = new Date("Thu Feb 7 2019" + " UTC");
document.getElementById("date").innerHTML = date.toJSON().slice(0, 10);
var url=window.location.href.split("?")[0];
var filename=url.substring(url.lastIndexOf('/')+1);
document.getElementById("maillink").href = "mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback"+decodeURIComponent("%26")+"body=File%20name%3A%20"+encodeURIComponent(filename);
</script>
</div>
</body>
</html>
